The key to blame: Gradual typing meets cryptography
نویسندگان
چکیده
We connect three ways to achieve relational parametricity: universal types, runtime type generation, and cryptographic sealing. We study a polymorphic blame calculus, λB, inspired by that of Ahmed, Findler, Siek, and Wadler (2011), that ties universal types to runtime type generation; and a cryptographic lambda calculus, λK, inspired by that of Pierce and Sumii (2000), that relies on cryptographic sealing. Our λB calculus avoids the ‘topsy turvy’ aspects of Ahmed et al., who evaluate terms one would expect to be values, and leave as values terms one would expect to be evaluated. We present translations from λB to λK and back that we show to be simulations. We extract from λB the subset λG that corresponds to the polymorphic lambda calculus λF of Girard (1972) and Reynolds (1974); λG is also a subset of the system G studied by Neis, Dreyer, and Rossberg (2009). We present translations from λF to λG and back that we show to be fully abstract. Further, we shed light on the embedding given by Pierce and Sumii of λF into λK, describing how it is related to the composition of our translations from λF to λG and λB to λK, and that the conversions and casts of λB relate to the C and G components of their embedding.
منابع مشابه
Supplement to: The key to blame: Gradual typing meets cryptography
We have ∀X.A′ ≺ ∀X.B, so A′ ≺ B. Also, we have Σ ` V X : A′, so the RHS has type B = A. • Case (V : A′ p =⇒ ∀X.B) X 7−→ V : A′ p =⇒ B : We have A′ ≺ ∀X.B, so A′ ≺ B. Thus, the RHS has type B = A. • Case V : ∀X.A′ p =⇒ B 7−→ (V ?) : A′[X:=?] p =⇒ B : We have ∀X.A′ ≺ B, so A′[X:=?] ≺ B by Lemma 1. Thus, the RHS has type B. Definition 3. Well-typed contexts, written Σ B E : B ⇒ A, are defined in t...
متن کاملA Complement to Blame
Contracts, gradual typing, and hybrid typing all permit less-precisely typed and more-precisely typed code to interact. Blame calculus encompasses these, and guarantees blame safety: blame for type errors always lays with less-precisely typed code. This paper serves as a complement to the literature on blame calculus: it elaborates on motivation, comments on the reception of the work, critiques...
متن کاملBlame, coercions, and threesomes, precisely
We systematically present four calculi for gradual typing: the blame calculus of Wadler and Findler (2009); a novel calculus that pinpoints blame precisely; the coercion calculus of Henglein (1994); and the threesome calculus of Siek and Wadler (2010). Threesomes are given a syntax that directly exposes their origin as coercions in normal form, a more transparent presentation than that found in...
متن کاملSpace-Efficient Blame Tracking for Gradual Types
Static and dynamic type systems have well-known strengths and weaknesses. Gradual typing provides the benefits of both in a single language by giving the programmer control over which portions of the program are statically typed and which portions are dynamically checked based on the presence or absence of type annotations. A compiler for a gradually typed language infers where the dynamic chec...
متن کاملMonotonic References for Efficient Gradual Typing
Gradual typing enables both static and dynamic typing in the same program and makes it convenient to migrate code regions between the two typing disciplines. One goal of gradual typing is to provide all the benefits of static typing, such as efficiency, in statically-typed regions. However, this goal is elusive: the standard approach to mutable references imposes run-time overhead in statically...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2016